<!doctype html>
<html>

	<head>
		<meta charset="UTF-8">
		<title></title>
		<meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
		<link href="../../css/mui.min.css" rel="stylesheet" />
		<link rel="stylesheet" type="text/css" href="../../css/orderDetails.css" />
		<script type="text/javascript">
			// 获取HTML的DOM
			
		</script>
	</head>

	<body style="background-color: #F4F4F4;">
		<div id="details">
			<header class="mui-bar mui-bar-nav">
				
				<a style="color: #fff;" class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
				<h1 class="mui-title" style="color: #fff;">报修信息详情</h1>
			</header>
			<div class="content">
				<div class="item-wapper margin-top15">
					<div class="desc bottom-underline">
						<span class="title" id='type'>[照明故障]</span> <span id='detail'>灯管坏了，需要维修。</span>
					</div>
					<div class="bottom-underline mui-scroll-wrapper mui-slider-indicator mui-segmented-control mui-segmented-control-inverted">
						<div class="mui-scroll">
							<div class="img-wapper margin-top15 " id='imgposition'>
								<!-- <div class="item-item" id='imgposition'>
									
									<img src="D:\repair_platform\repair_platform_api/app/images/8ae46b71-65c9-4c8a-a29f-b900e6dabb83.jpg" />
								</div> -->
								
							</div>
						</div>
					</div>
					
				</div>
				
                <div class="orderUser margin-top15">
                	<div class="item">
						<div class="item-title bottom-underline">
							<span class="title">位置</span>
							<span class="desc" id='location'>宿舍楼1栋-1-102</span>
						</div>
					</div>
					<div class="item">
						<div class="item-title bottom-underline">
							<span class="title">联系人</span>
							<span class="desc" id='contactName'>Lark</span>
						</div>
					</div>
					<div class="item" @click="goiponeClick">
						<div class="item-title">
							<span class="title">联系电话</span>
							<div class="ipone" id='contactPhone'>13120527838</span></div>
						</div>
					</div>
                </div>
                
                <div class="schedule margin-top15">
                	
                	<div class="flowPath-wapper" id='process'>
                		<!-- <div class="list-item left-icon-red">
                			<div class="item-time" >2022-5-31 15:08</div>
                			<div class="item-title">管理人员已完成报修</div>
                		</div>
                		<div class="list-item left-icon-hui">
                			<div class="item-time">2022-5-31 15:08</div>
                			<div class="item-title">张师傅已上门</div>
                		</div>
                		<div class="list-item left-icon-hui">
                			<div class="item-time">2022-5-31 15:08</div>
                			<div class="item-title">维修师傅正在赶去的路上</div>
                		</div>
                		<div class="list-item left-icon-hui">
                			<div class="item-time">2022-5-31 15:08</div>
                			<div class="item-title">订单已提交成功</div>
                		</div> -->
                	</div>
                </div>
			</div>
		</div>
		<script src="../../js/mui.min.js"></script>
		<script src="../../js/vue.js" type="text/javascript" charset="utf-8"></script>
		<script type="text/javascript">
			var htmlDom = document.getElementsByTagName('html')[0];
			var htmlWidth = document.documentElement.clientWidth || document.body.clientWidth;
			// 设置html的fontsize
			htmlDom.style.fontSize = htmlWidth / 10 + 'px';
			mui.init()
			mui.plusReady(function () {
				var Sdata = plus.webview.currentWebview();
				repairID = Sdata.orderID;
			    mui.get('http://192.168.0.102:9527/api_1_0/repairInfo/getRepairDetail',{
			    		repairID:repairID
			    	},function(data){
						// 维修类型
						repairType = data.data.repairType;
			    		document.getElementById("type").innerText = '['+repairType+']';
						// 维修详情
						repairDetail = data.data.repairDetail;
						document.getElementById("detail").innerText = repairDetail;
						// 维修图片
						// <!-- <div class="item-item">
							
						// 	<img src="D:\repair_platform\repair_platform_api/app/images/8ae46b71-65c9-4c8a-a29f-b900e6dabb83.jpg" />
						// </div> -->
						repairImgInfo = data.data.repairImgInfo;
						imglist = document.getElementById("imgposition");
						for(var i=0;i<repairImgInfo.length;i++){
							var imgitem_div = document.createElement("div");
							imgitem_div.className="item-item";
							var imgitem = document.createElement("img");
							imgitem.src = "data:;base64,"+repairImgInfo[i];
							
							imgitem_div.appendChild(imgitem);
							document.getElementById("imgposition").appendChild(imgitem_div);
						}
						// 维修位置
						repairPlace = data.data.repairPlace;
						document.getElementById("location").innerText = repairPlace;
						contactName = data.data.contactName;
						document.getElementById("contactName").innerText = contactName;
						contactPhone = data.data.contactPhone;
						document.getElementById("contactPhone").innerText = contactPhone;
						// <div class="list-item left-icon-hui">
						// 	<div class="item-time">2022-5-31 15:08</div>
						// 	<div class="item-title">订单已提交成功</div>
						// </div>
						if(data.data.status=='0'){
							
							var submit_div = document.createElement("div");
							submit_div.className = "list-item left-icon-hui";
							var submit_time_div = document.createElement("div");
							submit_time_div.className = "item-time";
							submit_time = data.data.createTime;
							
							
							submit_time_div.innerText = submit_time;
							
							var submit_title_div = document.createElement("div");
							submit_title_div.className = "item-title";
							submit_title_div.innerText = "订单已提交成功";
							submit_div.appendChild(submit_time_div);
							submit_div.appendChild(submit_title_div);
							
							
							document.getElementById("process").appendChild(submit_div);
							
						}else if(data.data.status=='1'){
							console.log(data.data.status);
							var submit_div = document.createElement("div");
							submit_div.className = "list-item left-icon-hui";
							var submit_time_div = document.createElement("div");
							submit_time_div.className = "item-time";
							submit_time_div.innerText = data.data.createTime;
							var submit_title_div = document.createElement("div");
							submit_title_div.className = "item-title";
							submit_title_div.innerText = "订单已提交成功";
							submit_div.appendChild(submit_time_div);
							submit_div.appendChild(submit_title_div);
							
							var running_div = document.createElement("div");
							running_div.className = "list-item left-icon-hui";
							var running_time_div = document.createElement("div");
							running_time_div.className = "item-time";
							running_time_div.innerText = data.data.updateTime;
							var running_title_div = document.createElement("div");
							running_title_div.className = "item-title";
							running_title_div.innerText = data.data.workerName + "正在赶去的路上（联系电话：" + data.data.workerPhone + ")";
							running_div.appendChild(running_time_div);
							running_div.appendChild(running_title_div);
							
							var door_div = document.createElement("div");
							door_div.className = "list-item left-icon-red";
							var door_time_div = document.createElement("div");
							door_time_div.className = "item-time";
							door_time_div.innerText = data.data.updateTime;
							var door_title_div = document.createElement("div");
							door_title_div.className = "item-title";
							door_title_div.innerText = data.data.workerName + "已上门";
							door_div.appendChild(door_time_div);
							door_div.appendChild(door_title_div);
							
							document.getElementById("process").appendChild(door_div);
							document.getElementById("process").appendChild(running_div);
							document.getElementById("process").appendChild(submit_div);
						}else{
							var submit_div = document.createElement("div");
							submit_div.className = "list-item left-icon-hui";
							var submit_time_div = document.createElement("div");
							submit_time_div.className = "item-time";
							submit_time_div.innerText = data.data.createTime;
							var submit_title_div = document.createElement("div");
							submit_title_div.className = "item-title";
							submit_title_div.innerText = "订单已提交成功";
							submit_div.appendChild(submit_time_div);
							submit_div.appendChild(submit_title_div);
							
							var running_div = document.createElement("div");
							running_div.className = "list-item left-icon-hui";
							var running_time_div = document.createElement("div");
							running_time_div.className = "item-time";
							running_time_div.innerText = data.data.updateTime;
							var running_title_div = document.createElement("div");
							running_title_div.className = "item-title";
							running_title_div.innerText = "王师傅正在赶去的路上（联系电话：13820193210)";
							running_div.appendChild(running_time_div);
							running_div.appendChild(running_title_div);
							
							var door_div = document.createElement("div");
							door_div.className = "list-item left-icon-hui";
							var door_time_div = document.createElement("div");
							door_time_div.className = "item-time";
							door_time_div.innerText = data.data.updateTime;
							var door_title_div = document.createElement("div");
							door_title_div.className = "item-title";
							door_title_div.innerText = "王师傅已上门";
							door_div.appendChild(door_time_div);
							door_div.appendChild(door_title_div);
							
							var done_div = document.createElement("div");
							done_div.className = "list-item left-icon-red";
							var done_time_div = document.createElement("div");
							done_time_div.className = "item-time";
							done_time_div.innerText = data.data.finishTime;
							var done_title_div = document.createElement("div");
							done_title_div.className = "item-title";
							done_title_div.innerText = "已完成维修";
							done_div.appendChild(done_time_div);
							done_div.appendChild(done_title_div);
							
							document.getElementById("process").appendChild(done_div);
							document.getElementById("process").appendChild(door_div);
							document.getElementById("process").appendChild(running_div);
							document.getElementById("process").appendChild(submit_div);
						}
			    	},'json'
			    );
			});
			
		</script>
	</body>

</html>